]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: fix allocation loop when increasing icon size
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 22 Dec 2012 14:24:11 +0000 (15:24 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 20 Feb 2013 19:51:11 +0000 (20:51 +0100)
The DashActor will known to allocate the show apps button only if the
icon size is (temporarily) too big for the containing box, therefore
it should request just that as the minimum size.
This solves a glitch that happened when removing a favorite and at the
same time causing the dash to expand.

https://bugzilla.gnome.org/show_bug.cgi?id=690643

js/ui/dash.js

index 2c91710bff106f4a5f1525b3006ef46d8f5022a1..daf1ad13e0e05f599df9b1b82d88438ef26ee929 100644 (file)
@@ -354,6 +354,23 @@ const DashActor = new Lang.Class({
         childBox.y1 = contentBox.y2 - showAppsNatHeight;
         childBox.y2 = contentBox.y2;
         showAppsButton.allocate(childBox, flags);
+    },
+
+    vfunc_get_preferred_height: function(forWidth) {
+        // We want to request the natural height of all our children
+        // as our natural height, so we chain up to StWidget (which
+        // then calls BoxLayout), but we only request the showApps
+        // button as the minimum size
+
+        let [, natHeight] = this.parent(forWidth);
+
+        let themeNode = this.get_theme_node();
+        let adjustedForWidth = themeNode.adjust_for_width(forWidth);
+        let [, showAppsButton] = this.get_children();
+        let [minHeight, ] = showAppsButton.get_preferred_height(adjustedForWidth);
+        [minHeight, ] = themeNode.adjust_preferred_height(minHeight, natHeight);
+
+        return [minHeight, natHeight];
     }
 });